<?php
if(empty($_POST['formAction'])){
	$__userinfo['income_options'] = make_options(Statics::$income_arr, false, $__userinfo['income']);
	if(file_exists(UP_PTH.'thumb/'.$__userinfo['avatar'])){	// 如果有生成小图
		$__userinfo['thumb'] = 'thumb/'.$__userinfo['avatar'];
	}else{
		$__userinfo['thumb'] = $__userinfo['avatar'];
	}
	$vars['userinfo'] = $__userinfo;
	$vars['uc_avatar_edit']  = $__oUser->uc_avatar_edit();

	$oAddress = new Address();
	if(empty($__userinfo['province_id'])){
		$address_info = array(
			'province_id'	=> 0,
		);
	}else{
		$address_info = array();
		$citys = $oAddress->get_citys($__userinfo['province_id']);
		$areas = $oAddress->get_areas($__userinfo['city_id']);
		$address_info['city_options'] = make_options($citys, '', $__userinfo['city_id']);
		$address_info['area_options'] = make_options($areas, '', $__userinfo['area_id']);
	}
	$provinces = $oAddress->get_provinces();
	$address_info['province_options'] = make_options($provinces, '', $__userinfo['province_id']);
	$vars['address_info'] = $address_info;
}else{
	$r = $__oUser->edit_userinfo($__userinfo['userid'], $_POST);
	if($r['result'] == 'succ'){
		ajax_msg('succ', '', 'callback_userinfo_save', $r['data']['synjs']);
	}
	ajax_msg($r['result'], $r['errmsg'], 'callback_userinfo_save');
}
?>